<template>
	<view class="live_managment_container">
		<view class="live_managment_box">
			<view class="live_top_box">
				<view class="left_box">
					<image src="/static/my/liveManagment/icon-notice.png" mode="" class="left_img"></image>
				</view>
				<view class="right_box">
					绑定审核时间24小时内，节假日清单独联系上游处理，多账户绑定同一个账号，禁止虚假选择、私自包装，违约者解除合作，抖音小程序官方有使用考核，挂载不适用或者浪费名额的将解除权限.
				</view>
			</view>

			<view class="live_middle_box">
				<view class="live_middle_all" v-for="(item, index) in liveImgList" :key="index" @click="handleChooseLive(item)">
					<view class="live_middle_img_box">
						<image :src="item.img" mode="" class="live_middle_img"></image>
					</view>
					<view class="live_middle_title">
						{{ item.title }}
					</view>
				</view>
			</view>
		</view>

		<!-- 弹窗提示 -->
		<u-popup v-model="showTip" mode="center" width="650" border-radius="12">
			<view class="show_tip_box">
				<view class="show_tip">提示</view>
				<view class="show_title">抖音小程序直播需填写用户姓名和手机号，用作于直播申请的审核使用，数据库不会保存用户信息。</view>
				<view class="show_btn_box">
					<view class="show_cancel_btn" @click="handleCancel">取消</view>
					<view class="show_sure_btn" @click="handleSure">确定</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
export default {
	data() {
		return {
			showTip: false,
			liveImgList: [],
			userIsAgent: uni.getStorageSync('h5-isAgent'),
			douyinLiveImg: 'https://file-1314054542.cos.ap-shanghai.myqcloud.com/cos_file/wechat_xcx/66836167e2de3_1719886183.png',
			miniLiveImg: 'https://file-1314054542.cos.ap-shanghai.myqcloud.com/cos_file/wechat_xcx/668361a869f77_1719886248.png'
		};
	},
	onLoad() {
		this.getLiveImgList();
	},
	methods: {
		getLiveImgList() {
			this.liveImgList = [
				{
					img: this.douyinLiveImg,
					title: '抖音小黄车直播'
				},
				{
					img: this.miniLiveImg,
					title: '抖音小程序直播'
				}
			];
		},

		// 选择直播类型
		handleChooseLive(val) {
			if (val.title == '抖音小黄车直播') {
				uni.navigateTo({
					url: '/pages/my/douyinLive/douyinLive'
				});
			} else if (val.title == '抖音小程序直播') {
				this.showTip = true;
			}
		},

		// 取消
		handleCancel() {
			this.showTip = false;
		},

		// 确定
		handleSure() {
			uni.navigateTo({
				url: '/pages/agentPortion/my/miniProgramLive/miniProgramLive'
			});
			this.showTip = false;
		}
	}
};
</script>

<style lang="scss" scoped>
.live_managment_container {
	padding: 17rpx 22rpx 0;

	.live_managment_box {
		.live_top_box {
			display: flex;
			align-items: flex-start;
			justify-content: space-between;
			background: #fffeec;
			border-radius: 14rpx;
			padding: 24rpx 18rpx 24rpx 18rpx;

			.left_box {
				width: 25rpx;
				height: 22rpx;

				.left_img {
					width: 100%;
					height: 100%;
				}
			}

			.right_box {
				width: 629rpx;
				font-family: all-font;
				font-weight: 400;
				font-size: 22rpx;
				color: #ee3121;
				line-height: 36rpx;
			}
		}

		.live_middle_box {
			display: flex;
			justify-content: space-between;
			padding-top: 18rpx;

			.live_middle_all {
				position: relative;

				.live_middle_img_box {
					width: 344rpx;
					height: 281rpx;

					.live_middle_img {
						width: 100%;
						height: 100%;
					}
				}

				.live_middle_title {
					position: absolute;
					bottom: 34rpx;
					left: 80rpx;
					font-family: all-font;
					font-weight: 500;
					font-size: 26rpx;
					color: #333333;
				}
			}
		}
	}

	.show_tip_box {
		padding: 30rpx 20rpx;

		.show_tip {
			font-size: 30rpx;
			font-family: screen-font;
			text-align: center;
		}

		.show_title {
			font-size: 32rpx;
			font-family: screen-font;
			padding: 30rpx 0;
		}

		.show_btn_box {
			display: flex;
			justify-content: space-between;
			padding: 0 30rpx;

			.show_cancel_btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 264rpx;
				height: 88rpx;
				background: #e4f0ff;
				border-radius: 6rpx;
				font-family: button-font;
				font-weight: 500;
				font-size: 30rpx;
				color: #368eff;
			}

			.show_sure_btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 264rpx;
				height: 88rpx;
				background: #368eff;
				border-radius: 6rpx;
				font-family: button-font;
				font-weight: 500;
				font-size: 30rpx;
				color: #ffffff;
			}
		}
	}
}
</style>
